<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       //9, 取出数组[1,3,1,4,2,3,6,2,6,1,5]中的重复项,存入一个新的数组,并从大到小排序 
    var arr=[1,3,1,4,2,3,6,2,6,1,5];
    var arr2=[];
    arr.sort(function(a,b){
        return b-a;
    })
    for(var i=0;i<arr.length;i++){
        if(arr[i]==arr[i+1]&&arr2.indexOf(arr[i])==-1){
            arr2.push(arr[i]);
        }
    }
    console.log(arr2);
    </script>
</body>
</html>